//
//  BriefVC.swift
//  甜言蜜语
//
//  Created by yingli_yanfa_liuxingyu on 17/1/16.
//  Copyright © 2017年 wl. All rights reserved.
//

import UIKit
import SVProgressHUD
class BriefVC: UIViewController, UITextViewDelegate {
    
    @IBOutlet weak var textView: UITextView!
    @IBOutlet weak var lbl: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.textView.delegate = self
        self.textView.layer.masksToBounds = true
        self.textView.layer.borderWidth = 1
        self.textView.layer.borderColor = UIColor.lightGrayColor().CGColor

        // Do any additional setup after loading the view.
    }
    override func viewWillAppear(animated: Bool) {
        self.tabBarController?.tabBar.hidden = true
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @IBAction func complete() {
        if self.textView.text.characters.count == 0 {
            SVProgressHUD.showErrorWithStatus("请输入简介")
            return
        }
        SVProgressHUD.showWithStatus("请稍后...")
        //修改个人信息
        let modityDic = ["introduction": self.textView.text]
            DataTool.modifyUserInfomation(modityDic, completionHandler: { (newModel) in
                guard newModel != nil else {
                    return
                }
                
                SVProgressHUD.showSuccessWithStatus(newModel?.msg)
                
                self.navigationController?.popViewControllerAnimated(true)
                
                
            })
    }
    func textViewDidBeginEditing(textView: UITextView) {
         self.lbl.alpha = 0
    }
    
//    func textViewShouldBeginEditing(textView: UITextView) -> Bool {
//        self.lbl.alpha = 0
//        
//        return true
//        
//    }
    

}
